<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0">
    <title>Universal Touch Gamepad Test</title>
    <style>
        body, html { margin: 0; padding: 0; width: 100%; height: 100%; font-family: Arial, sans-serif; background-color: #f0f0f0; display: flex; flex-direction: column; align-items: center; }
        .control-panel { margin: 15px; padding: 15px; background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 1000; }
        .control-panel button { margin: 5px; padding: 8px 12px; border-radius: 4px; border: 1px solid #ccc; background-color: #e9e9e9; font-size: 14px; cursor: pointer; }
        .control-panel button:hover { background-color: #ddd; }
        .status-display { padding: 15px; background-color: #fff; border-radius: 8px; max-height: 60vh; overflow-y: auto; min-width: 350px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 999; margin-top: 10px; }
        .status-display h2 { margin-top: 0; text-align: center; border-bottom: 1px solid #eee; padding-bottom: 8px; color: #333; }
        .axes-info, .buttons-info { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.9em; line-height: 1.5; }
        .buttons-info .button-state { display: inline-block; padding: 3px 6px; margin: 2px; border-radius: 3px; background-color: #eee; min-width: 85px; text-align: center; }
        .buttons-info .button-state.pressed { background-color: #4CAF50; color: white; font-weight: bold; }
    </style>
</head>
<body>
    <div class="control-panel">
        <button id="toggle-gamepad-btn">Show Touch Gamepad</button>
    </div>

    <div id="touch-gamepad-container"></div>

    <div class="status-display">
        <h2>Gamepad API Status</h2>
        <div class="status-section">
            <h3>Info:</h3>
            <div id="gamepad-info-id">ID: N/A</div>
            <div id="gamepad-info-connected">Connected: false</div>
            <div id="gamepad-info-index">Index: N/A</div>
            <div id="gamepad-info-mapping">Mapping: N/A</div>
        </div>
        <div class="status-section">
            <h3>Axes:</h3>
            <div class="axes-info" id="axes-status-display"></div>
        </div>
        <div class="status-section">
            <h3>Buttons:</h3>
            <div class="buttons-info" id="buttons-status-display"></div>
        </div>
    </div>

    <script src="universalTouchGamepad.js"></script>
    <script src="app.js"></script>
</body>
</html>
